/////////////////////////////////////////////////////////////////////////////////////////////
// Filename: WindowsOwnedStates.cpp
// (c) Dave Ottley, 2012. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////
//		INCLUDES
///////////////////////////
#include <assert.h>

///////////////////////////
//		MY INCLUDES
///////////////////////////
#include "WindowsClass.h"
#include "WindowsOwnedStates.h"
#include "WindowsMessages.h"

//------------------------------------------------------methods for WindowsNormalState
WindowsNormalState * WindowsNormalState::GetInstance()
{
	static WindowsNormalState theOne;

	return &theOne;
}

void WindowsNormalState::Enter(WindowsClass * windowsSubsystem)
{
	//...
}

void WindowsNormalState::Execute(WindowsClass * windowsSubsystem)
{
	   
	//...

}

void WindowsNormalState::Exit(WindowsClass * windowsSubsystem)
{
	//...
}

bool WindowsNormalState::OnMessage(WindowsClass * windowsSubsystem, const Telegram& msg)
{
	switch(msg.Msg)
	{
	case WindowsMsg::RequestScreenDimensions:
		{
			int * screenDimensions = (int*) msg.ExtraInfo;
			screenDimensions[0] = windowsSubsystem->GetScreenWidth();
			screenDimensions[1] = windowsSubsystem->GetScreenHeight();
			return true;
			break;
		}

	case WindowsMsg::RequestWindowHandle:	
		{
			HWND * temp = (HWND *) msg.ExtraInfo;
			*temp = windowsSubsystem->GetHwnd();
			return true;
			break;
		}
		
	default:
		assert(false && "<WindowsGlobalState::OnMessage> Unkown Windows Message");
		return false;

	}

}

//------------------------------------------------------methods for WindowsGlobalState
WindowsGlobalState * WindowsGlobalState::GetInstance()
{
	static WindowsGlobalState theOne;

	return &theOne;
}

void WindowsGlobalState::Enter(WindowsClass * windowsSubsystem)
{
	//...
}

void WindowsGlobalState::Execute(WindowsClass * windowsSubsystem)
{
	   
	//...

}

void WindowsGlobalState::Exit(WindowsClass * windowsSubsystem)
{
	//...
}

bool WindowsGlobalState::OnMessage(WindowsClass * windowsSubsystem, const Telegram& msg)
{
	//...
	return true;
}